Matlab Overview
Numeric Computing in Matlab
Matlab is a numeric computing environment. It is important to understand the
difference between symbolic computing and numeric computing.
You will not be able to solve things symbolically in Matlab.
For example, in Math class and in Maple,
the equation x+y=3z
can be solved algebraically
for any of the variables x
, y
, and z
to get x=3z-y
or
y=3z-x
or z=(x+y)/3
, respectively. However, in a numeric computing
environment such as Matlab, you do not enter equations to solve. You can compute
values of expressions and assign them to variable names similar to the
way that you use a calculator. However, Matlab is much more sophisticated than
your calculator and it can be used to implement and save problem solving steps (algorithms)
that solve very complex problems. Let's start with a tour of Matlab's environment windows.
Matlab takes a while to start up and it may lock up if you attempt to work before it has finish loading, so wait until it has finished before trying to enter anything. Once Matlab has finished loading, you see two window tiles on the left and one on the right side of the screen. There is also a fourth window hidden behind the top window on the left. This default view can be changed by you, the user. Before you make changes, let's review the windows available in the default view:
The Command Window
The Command Window is largest and takes up the right side of the screen. This is where you can type any calculations that you wish to evaluate. It works similar to a calculator except that the keyboard is used to enter the numbers and operators.
The Current Directory Window
The Current Directory window is in the top window on the left and it is used to show in which directory (in your computer or network file system) you are currently working. It is important to know in which directory your work is being saved so that you can find it in future Matlab sessions. The current directory is also displayed in the tool bar above the Command Window.
The Command History Window
The Command History window is in the lower left window frame. It shows the most recently executed commands and can be used to repeat a command.
The Workspace Window
The Workspace window is hidden behind the Current Directory window. This window will show you which variable names have been assigned values and what those values are. It is most useful when trying to debug program code.
The File Editor Window
The file Editor window is another window that you will use throughout your work in Matlab. The Editor window is used to define your own formulas (functions) and to save lists of commands (program scripts) that can be run over and over.
The Editor window is not showing when you first run Matlab. To see the Editor window, you will create or open an m-file. The next lesson describes how to do this.